<?php
/**
 * Load Company Once
 * To be included as the first component of any company view
 * 
 * @package Hive\Company
 * @author Xavier VILAIN
 * @license
 */
use Hive\Company;
use Fox\Generator;

$id = Xview::instance()->val('compid',Xview::instance()->val('cpid'));
try {
	/* @var $company Hive\Company */
	$company = Fox\Dao::load(Hive\Company::className(),$id);
}
catch (Fox\Object\Exception\NotExist $e)
{
	Xview::instance()->systemError($e->getMessage(),Generator::url(Company::BUNDLE,'search'));
}
return $company;